<html>
<head><meta charset="utf-8"><title>learning chalk · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/learning.20chalk.html">learning chalk</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="186854461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/learning%20chalk/near/186854461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/learning.20chalk.html#186854461">(Jan 29 2020 at 04:02)</a>:</h4>
<p>I'm incredibly confused by this struct: <a href="https://github.com/rust-lang/chalk/blob/master/chalk-integration/src/db.rs#L34-L36" target="_blank" title="https://github.com/rust-lang/chalk/blob/master/chalk-integration/src/db.rs#L34-L36">https://github.com/rust-lang/chalk/blob/master/chalk-integration/src/db.rs#L34-L36</a></p>



<a name="186854466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/learning%20chalk/near/186854466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/learning.20chalk.html#186854466">(Jan 29 2020 at 04:02)</a>:</h4>
<p>Where is <code>set_solver_choice</code> defined?</p>



<a name="186854573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/learning%20chalk/near/186854573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/learning.20chalk.html#186854573">(Jan 29 2020 at 04:05)</a>:</h4>
<p>I see that there's some derive-macro magic happening with salsa - it looks like it's defining methods of the form <code>set_#name</code>. However, I don't really understand how everything connects up</p>



<a name="186855888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/learning%20chalk/near/186855888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/learning.20chalk.html#186855888">(Jan 29 2020 at 04:41)</a>:</h4>
<p>I noticed that the <code>NoSolution</code> type is an empty struct. Are the plans to extend it with some kind of "cause" or "message", similar to how things work in rustc?</p>



<a name="186861636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/learning%20chalk/near/186861636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/learning.20chalk.html#186861636">(Jan 29 2020 at 07:18)</a>:</h4>
<p>For <code>set_solver_choice</code>, the setter is created because <code>LoweringDatabase</code> has a <code>fn solver_choice</code> with a <code>#[salsa::input]</code> annotation. Not entirely sure though how <code>ChalkDatabase</code> gets linked to <code>LoweringDatabase</code>, though (I see <code>impl RustIrDatabase&lt;ChalkIr&gt; for ChalkDatabase</code>, but <code>LoweringDatabase</code> is a subtrait)</p>



<a name="186861653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/learning%20chalk/near/186861653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/learning.20chalk.html#186861653">(Jan 29 2020 at 07:19)</a>:</h4>
<p>The <a href="https://github.com/salsa-rs/salsa/blob/master/examples/hello_world/main.rs" target="_blank" title="https://github.com/salsa-rs/salsa/blob/master/examples/hello_world/main.rs">examples in the salsa repo</a> explain it a bit better</p>



<a name="186909250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/learning%20chalk/near/186909250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/learning.20chalk.html#186909250">(Jan 29 2020 at 17:37)</a>:</h4>
<p>Yeah, honestly the <code>db</code>-related things are salsa-magic</p>



<a name="186909314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/learning%20chalk/near/186909314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/learning.20chalk.html#186909314">(Jan 29 2020 at 17:38)</a>:</h4>
<blockquote>
<p>I noticed that the <code>NoSolution</code> type is an empty struct. Are the plans to extend it with some kind of "cause" or "message", similar to how things work in rustc?</p>
</blockquote>
<p>I don't <em>think</em> there are currently any plans. But maybe in the future?</p>



<a name="186938948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/learning%20chalk/near/186938948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/learning.20chalk.html#186938948">(Jan 29 2020 at 23:18)</a>:</h4>
<p>It looks like auto-trait support (emitting the proper clauses) is currently only handled by the 'standalone' part of chalk (<code>chalk_rust_ir</code>, <code>chalk_ir</code>), and not by rustc. Would that be a reasonable thing for me to work on?</p>



<a name="186941943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/learning%20chalk/near/186941943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/learning.20chalk.html#186941943">(Jan 29 2020 at 23:59)</a>:</h4>
<p>So, auto-trait support sort of overlaps with the idea of "well-known" traits (like <code>Sized</code>, see <a href="https://github.com/rust-lang/chalk/issues/261" target="_blank" title="https://github.com/rust-lang/chalk/issues/261">this issue</a>)</p>



<a name="186942058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/learning%20chalk/near/186942058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/learning.20chalk.html#186942058">(Jan 30 2020 at 00:00)</a>:</h4>
<p>But, I'm not 100% sure what needs to specifically be addressed for auto-traits in particular</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>